/// Cleans the project from build artifacts.
pub fn clean(manifest_path: &Path, opts: &CleanOptions) -> CargoResult<()> {
- let mut src = try!(PathSource::for_path(manifest_path.parent().unwrap(),
- opts.config));
- try!(src.update());
- let root = try!(src.root_package());
+ let root = try!(Package::for_path(manifest_path, opts.config));
let target_dir = opts.config.target_dir(&root);
- // If we have a spec, then we need to delete some package,s otherwise, just
+ // If we have a spec, then we need to delete some packages, otherwise, just
// remove the whole target directory and be done with it!
let spec = match opts.spec {
Some(spec) => spec,